<layout name="layout" />
<link rel="stylesheet" href="/Css/algorithm.css" type="text/css">
<div class="pageheader notab">
	<h1 class="pagetitle">
		<a href="/" class="linkWay">首页/思路优化</a>
		&nbsp;<span class="divider">»</span>&nbsp;
		<a class="currentWay">我的思路</a>
	</h1>
</div>
<div id="contentwrapper" class="contentwrapper">
	<div id="maincontent" class="semiauto-list">
		<div class="section section-common-simies">
			<div class="section-title">通用思路</div>
			<div class="section-body">
				<table cellpadding="0" cellspacing="0" border="0" class="metrotable datatable">
					<thead>
					<tr>
						<th width="5%" class="head1">ID</th>
						<th width="13%" class="head0">思路</th>
						<th class="head1">内容</th>
						<th class="head0">来自</th>
						<th width="15%" class="head1">创建日期</th>
						<th width="15%" class="head0">操作</th>
					</tr>
					</thead>
					<tbody>
					<if condition="$list['public']['total_items'] == 0">
						<tr>
							<td colspan="6">暂无思路</td>
						</tr>
					<else/>
						<volist name="list['public']['items']" id="v">
							<tr <if condition="$v.status eq 2">class="red"</if>>
							<td>{$v.id}</td>
							<td>{$v.title}</td>
							<td class="content">
								{$v.content}
							</td>
							<td width="100">
								通用思路
							</td>
							<td>{$v.add_time}</td>
							<td>
								<a href="/algorithm/edit_semiauto?semiauto_id={$v.id}">编辑</a>
								<a href="javascript:;" class="think-delete" data-id="{$v.id}">删除</a>
								<br>
								<a href="javascript:;" class="think-execute" data-id="{$v.id}">执行思路</a>
								<if condition="$v.status eq 2">
									<br>
									<a href="/algorithm/status?id={$v.id}" class="red">解除异常</a>
								</if>
								<br>
								<a href="javascript:;" class="to-platform" data-title="{$v.title}" data-id="{$v.id}">转移到思路平台</a>
							</td>
							</tr>
						</volist>
					</if>
					</tbody>
				</table>
			</div>
		</div>
		<div class="section section-customized-algorithms">
			<div class="section-title">定制思路</div>
			<div class="section-body">
				<table cellpadding="0" cellspacing="0" border="0" class="metrotable datatable">
					<thead>
					<tr>
						<th width="5%" class="head1">ID</th>
						<th width="13%" class="head0">思路</th>
						<th class="head1">内容</th>
						<th class="head0">来自</th>
						<th width="15%" class="head1">创建日期</th>
						<th width="15%" class="head0">操作</th>
					</tr>
					</thead>
					<tbody>
					<if condition="$list['custom']['total_items'] == 0">
						<tr>
							<td colspan="6">暂无思路</td>
						</tr>
					<else/>
						<volist name="list['custom']['items']" id="v">
							<tr <if condition="$v.status eq 2">class="red"</if>>
							<td>{$v.id}</td>
							<td>{$v.title}</td>
							<td>
								{$v.content}
							</td>
							<td width="100">
								定制思路
							</td>
							<td>{$v.add_time}</td>
							<td>
								<a href="/algorithm/edit_semiauto?semiauto_id={$v.id}">编辑</a>
								<a href="javascript:;" class="think-delete" data-id="{$v.id}">删除</a>
								<br>
								<a href="javascript:;" class="think-execute" data-id="{$v.id}">执行思路</a>
								<if condition="$v.status eq 2">
									<br>
									<a href="/algorithm/status?id={$v.id}" class="red">解除异常</a>
								</if>
							</td>
							</tr>
						</volist>
					</if>
					</tbody>
				</table>
			</div>
		</div>
		<div class="section section-copied-algorithms">
			<div class="section-title">我复制的策略（思路）</div>
			<div class="section-body">
				<table cellpadding="0" cellspacing="0" border="0" class="metrotable datatable">
					<thead>
					<tr>
						<th width="5%" class="head1">ID</th>
						<th class="head0">来自</th>
						<th width="15%" class="head1">操作</th>
					</tr>
					</thead>
					<tbody>
					<if condition="$list['platform']['total_items'] == 0">
						<tr>
							<td colspan="3">暂无复制的策略</td>
						</tr>
						<else/>
						<volist name="list['platform']['items']" id="v">
							<tr>
								<td>{$v.id}</td>
								<td width="100" class="menuFullName">
									{$v.menu_full_name}
								</td>
								<td>
									<a href="javascript:;" data-id="{$v.id}" class="platSilu">详情</a>
								</td>
							</tr>
						</volist>
					</if>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>

<script id="silu-to-platform" type="text/html">
	<div class="toPlatform"></div>
	<br clear="all">
	<div class="btnBOx">
		<form>
			<input type="hidden" id="platform" name="platform" value="">
			<input type="hidden" id="siluId" name="siluId" value="<%= siluId%>">
			<button type="button" class="subToPlatform">确定</button>
		</form>
	</div>
</script>
<script id="myCpoySilu" type="text/html">
	<div style="padding: 10px 10px;max-height:400px;overflow:auto;">
		<table cellpadding="0" cellspacing="0" border="0" class="metrotable datatable">
			<thead id="">
			<tr>
				<th width="5%" class="head1">ID</th>
				<th width="13%" class="head0">思路</th>
				<th class="head1">内容</th>
				<th width="15%" class="head0">创建日期</th>
				<th width="15%" class="head1">操作</th>
			</tr>
			</thead>
			<tbody id="con-list-tr">
			<% if(total_items == 0) { %>
			<tr>
				<td colspan="6">暂无思路</td>
			</tr>
			<% } else { %>
			<% for (i = 0; i < total_items; i ++) { %>
			<tr>
				<td><%= items[i].id %></td>
				<td><%= items[i].title %></td>
				<td>
					<%== items[i].content %>
				</td>
				<td><%= items[i].add_time %></td>
				<td>
					<a href="javascript:;" class="think-edit" data-id="<%= items[i].id %>">编辑</a>&nbsp;
					<a href="javascript:;" class="think-delete" data-id="<%= items[i].id %>">删除</a>
					<br>
					<a href="javascript:;" class="think-execute" data-id="<%= items[i].id %>">执行思路</a>
				</td>
			</tr>
			<% } %>
			<% } %>
			</tbody>
		</table>
	</div>
</script>

<include file="{APP_PATH}Template/Algorithm/executor.html" />

<script type="text/javascript">
	var user_id = {$me['user_id']};
	$(document).ready(function(){
		list = algorithm.list($('#maincontent'), {user_id: user_id});
		list.init();
	});
</script>
